﻿<div ng-controller="skuController" class="ng-scope">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li><a ui-sref="app.product.sku" href="#/app/product/sku/add">商品规格</a></li>
                <li class="active ng-binding" ng-bind="breadcrumb">新增</li>
            </ol>
        </div>
    </div>
    <form name="_form" class="form-horizontal w5c-form ng-pristine ng-invalid ng-invalid-required" w5c-form-validate="model.validateOptions" role="form" novalidate="">
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label">名称</label>
            <div class="col-sm-3">
                <input type="text" name="name" class="form-control input-sm ng-pristine ng-untouched valid ng-empty ng-invalid ng-invalid-required" ng-model="model.name" required="">
            </div>
        </div>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label">规格值</label>
            <div class="col-sm-10 row">
                <p class="form-control-static"><a href="javascript:void(0);" ng-click="add_sku()">新增</a></p>
                <div ng-repeat="(key,item) in model.sku_values track by $index" class="clearfix ng-scope" style="padding:5px 0px;">
                    <div class="col-sm-3">
                        <input ng-model="item.id" type="hidden" class="ng-pristine ng-untouched ng-valid ng-not-empty">
                        <input ng-model="item.name" class="form-control input-sm ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required" w5c-dynamic-name2="item.name_0" required="" name="item.name_0">
                    </div>
                    <div class="col-sm-9">
                        <button class="btn btn-primary btn-sm" ng-click="del_sku(key)"><i class="fa fa-trash"></i> 删除</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group form-group-sm">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-3">
                <button type="submit" w5c-form-submit="save()" class="btn btn-primary btn-sm ng-isolate-scope" btn-loading="psdisabled" loading-text="保存中..." ng-disabled="psdisabled">
                    <i class="fa fa-save"></i> 保存
                </button>
                <button ng-click="goBack()" class="btn btn-primary btn-sm"><i class="fa fa-rotate-left"></i> 取消</button>
            </div>
        </div>
    </form>
</div>